#数据库的配置变量
HOSTNAME = '127.0.0.1'
PORT     = '3306'
DATABASE = 'zl_flask'
USERNAME = 'root'
PASSWORD ='1234'
DB_URL   = 'mysql+pymysql://{}:{}@{}:{}/{}?charset=utf8'.format(USERNAME,PASSWORD,HOSTNAME,PORT,DATABASE)
SQLALCHEMY_DATABASE_URI = DB_URL
SQLALCHEMY_TRACK_MODIFICATIONS = True
"""
#数据库的配置变量(这段这么写才能扔到主函数)
HOSTNAME = '127.0.0.1'
PORT     = '3306'
DATABASE = 'zl_flask'
USERNAME = 'root'
PASSWORD ='1234'
DB_URL   = 'mysql+pymysql://{}:{}@{}:{}/{}?charset=utf8'.format(USERNAME,PASSWORD,HOSTNAME,PORT,DATABASE)
app.config['SQLALCHEMY_DATABASE_URI'] = DB_URL
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
"""